<?php
session_start();
    if (isset($_SESSION['login'])){
?>
<?php include 'head.php';?>
        <div class="row">
        <div class="row">
          
        </div>
        
      <div class="row">
      <div class="container-fluid main-content">
        <div class="page-title">
          <h1>
            Profissões
          </h1>
        </div>
        <!-- DataTables Example -->
        <div class="row">
          <div class="col-lg-12">
            <div class="widget-container fluid-height clearfix">
              <div class="heading">
                  <i class="fa fa-table"></i><a href="profissoes_add.php">Nova Profissão</a>
              </div>
                <div class="row">
                    <div class="col-lg-12">
                        <div class="widget-container fluid-height clearfix">
                            <div class="widget-content padded">
                                <form action="controle/processa_altera_profissao.php" class="form-horizontal">
                                    <div class="form-group">
                                        <label class="control-label col-md-2">Profissão</label>
                                        <div class="col-md-7">
                                            <?php 
                                                include 'conexao.php';
                                                $id_profissao = $_REQUEST['id_profissao'];
                                                $consulta_profissao = mysql_query("select * from profissao where idprofissao = '$id_profissao'");
                                                $profissao = mysql_result($consulta_profissao, 0 , 'profissaocol');
                                            ?>
                                            <input class="form-control" value="<?php echo $profissao?>" type="text" name="profissao">
                                            <input type="hidden" name="id_profissao" value="<?php echo $id_profissao?>">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-2"></label>
                                        <div class="col-md-7">
                                            <button class="btn btn-primary" type="submit">Submit</button><button class="btn btn-default-outline">Cancel            </button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <br />
            </div>
          </div>
        </div>
        <!-- end DataTables Example -->
      </div>

      </div>
      </div>
    </div>
    <div class="style-selector">
      <div class="style-selector-container">
        <h2>
          Layout Style
        </h2>
        <select name="layout"><option value="fluid">Fluid</option><option value="boxed">Boxed</option></select>
        <h2>
          Navigation Style
        </h2>
        <select name="nav"><option value="top">Top</option><option value="left">Left</option></select>
        <h2>
          Color Options
        </h2>
        <ul class="color-options clearfix">
          <li>
            <a class="blue" href="javascript:chooseStyle('none', 30)"></a>
          </li>
          <li>
            <a class="green" href="javascript:chooseStyle('green-theme', 30)"></a>
          </li>
          <li>
            <a class="orange" href="javascript:chooseStyle('orange-theme', 30)"></a>
          </li>
          <li>
            <a class="magenta" href="javascript:chooseStyle('magenta-theme', 30)"></a>
          </li>
          <li>
            <a class="gray" href="javascript:chooseStyle('gray-theme', 30)"></a>
          </li>
        </ul>
        <h2>
          Background Patterns
        </h2>
        <ul class="pattern-options clearfix">
          <li>
            <a class="active" href="#" id="bg-1"></a>
          </li>
          <li>
            <a href="#" id="bg-2"></a>
          </li>
          <li>
            <a href="#" id="bg-3"></a>
          </li>
          <li>
            <a href="#" id="bg-4"></a>
          </li>
          <li>
            <a href="#" id="bg-5"></a>
          </li>
        </ul>
        
      </div>
    </div>
  </body>
</html>
<?php
} else {
    echo "<script>alert('Voce nao esta logado')</script>";
    echo"<script>location.href='login2.php'</script>";

//    header('Location: login2.php');
}
?>